package cn.fenqing.druid.visitor;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.expr.SQLInListExpr;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

import java.sql.SQLException;
import java.util.List;

/**
 * @author fenqing
 */
public class InSQLASTVisitor implements SQLASTVisitor {

    @Override
    public void endVisit(SQLInListExpr x) {
        List<SQLExpr> targetList = x.getTargetList();
        if (targetList.size() > 10) {
            throw new RuntimeException("in 列表超过10个");
        }
    }
}
